<template>
  <div class="dashboard-container">
    <div class="content">
      <div class="title">
        任务列表
        <div class="right">
          <el-input placeholder="项目名称" v-model="params.name" size="mini" clearable style="width: 100px;margin-right: 5px;"></el-input>
          <el-input placeholder="编号" v-model="params.serialNumber" size="mini" clearable style="width: 100px;margin-right: 5px;"></el-input>
          <el-select v-model="params.status" placeholder="状态" size="mini" clearable style="width: 100px;margin-right: 5px;">
            <el-option v-for="item in STATUS_TYPE_LIST" :label="item.label" :key="item.value" :value="item.value"></el-option>
          </el-select>
          <el-button type="primary" icon="el-icon-search" plain size="mini" @click="getData">查询</el-button>
          <el-button type="primary" icon="el-icon-search" plain size="mini" @click="handleExport">导出</el-button>
          <el-button type="primary" icon="el-icon-search" plain size="mini" @click="handleInquire">新增询价</el-button>
        </div>
      </div>
      <el-table :data="list" v-loading="loading">
        <el-table-column prop="id" label="ID"></el-table-column>
        <el-table-column label="项目名称" prop="name"></el-table-column>
        <el-table-column label="编号" prop="serialNumber"></el-table-column>
        <el-table-column label="类型" prop="inquiryType"></el-table-column>
        <el-table-column label="业务类型">
          <template slot-scope="{row}">
            {{ row.customerCompanyBusiness?row.customerCompanyBusiness.name:'无' }}
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="询价时间"></el-table-column>
        <el-table-column label="状态">
          <template slot-scope="{row}">
           {{ row.status }} 
           <!-- {{row.replyUser?'；回价人:' + row.replyUser.realName:''}} -->
          </template>
        </el-table-column>
        <el-table-column prop="resultMessage" label="结果"></el-table-column>
        <el-table-column label="操作" width="150px">
          <template slot-scope="{row}" >
              <el-button type="text" size="mini" @click="handleLook(row)">查看询价</el-button>  
              <el-button type="text" size="mini" @click="handleSubmit(row)" v-if="row.status=='待提交'">提交询价</el-button>  
              <el-button type="text" size="mini" @click="handleDown(row)" v-if="row.docUrl">下载报告</el-button>  
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页 -->
      <div class="page">
          <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="params.pageIndex+1"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="params.pageCount"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total">
          </el-pagination>
      </div>

      <!-- 案例导出 -->
      <el-dialog 
        title="查看询价信息" 
        :visible="dialogVisible" 
        width="1200px" 
        @close="dialogVisible=false" 
        :close-on-click-modal="false"
      >
        <!-- <el-button type="primary" size="mini" v-if="temp.status==1" @click="handleSave">保存</el-button>
        <el-button type="primary" size="mini" v-if="temp.status==1" @click="handleSaveClose">保存并关闭</el-button> -->
        <el-button type="primary" size="mini" v-if="temp.docUrl" @click="handleDown(temp)">下载询价单</el-button>
        <!-- <el-button type="primary" size="mini" @click="handleGenerateDoc" v-if="temp.status==1">生成询价单</el-button>
        <el-button type="primary" size="mini" @click="submitFinish" v-if="temp.status==1&&temp.docUrl">提交回价</el-button> -->
        
        <div clas="tabs">
            <el-tabs v-model="activeName" @tab-click="handleClick">
                <el-tab-pane label="客户信息" name="first">
                  <el-form label-width="100px">
                    <el-form-item label="客户公司：">
                      {{temp.customerCompany.name}}
                    </el-form-item>
                    <el-form-item label="询价人：">
                      {{temp.customerUser.realName}}
                    </el-form-item>
                    <el-form-item label="询价编号：">
                      {{temp.serialNumber}}
                    </el-form-item>
                  </el-form>
                </el-tab-pane>
                <el-tab-pane label="委托对象" name="second">
                  <el-table v-for="(item, index2) in temp.subjects" :data="[temp.subjects[index2]]" :key="index2">
                    <el-table-column label="委托对象全称" prop="name"></el-table-column>
                    <el-table-column label="资产类型" prop="propertyType"></el-table-column>
                    <el-table-column label="面积(m²)" prop="area"></el-table-column>
                    <el-table-column v-for="(field,index) in item.majorFields" :label="field.field.name" :key="index">
                      <template slot-scope="{row}">
                        {{ row.majorFields[index].field.valueType == 0 ? row.majorFields[index].decimalValue.toFixed(2):'' }}
                        {{ row.majorFields[index].field.valueType == 2 ? row.majorFields[index].stringValue:'' }}
                        {{ row.majorFields[index].field.valueType == 1 ? dateTranfrom(row.majorFields[index].longValue):'' }}  
                        {{ row.majorFields[index].field.valueType == 3 ? (row.majorFields[index].longValue==1?'是':'否'):'' }}
                        {{ row.majorFields[index].field.valueType == 4 ? row.majorFields[index].enumItemName:'' }}
                      </template>
                    </el-table-column>
                    <el-table-column label="描述" prop="description"></el-table-column>
                  </el-table>
                </el-tab-pane>
                <el-tab-pane label="价格信息" name="third">
                  <el-form v-model="temp" label-width="130px">
                    <el-form-item label="项目名称：">
                      {{ temp.name }}
                      <!-- <el-input
                        size="mini" 
                        v-model="temp.name"
                        style="width: 500px" placeholder="请输入项目名称"
                        disabled=""
                      ></el-input> -->
                    </el-form-item>
                    <el-form-item label="描述：">
                      {{temp.description}}
                      <!-- <el-input 
                        type="textarea"
                        :rows="4"
                        v-model="temp.description" 
                        size="mini" 
                        style="width: 500px" placeholder="请输入描述"></el-input> -->
                    </el-form-item>
                    <el-divider><i class="el-icon-mobile-phone"></i></el-divider>
                    <el-form-item v-for="(item, index) in temp.fields" :label="item.name" :key="index">
                      <!-- <el-input 
                          size="mini"
                          v-model="item['decimalValue']" 
                          :placeholder="'请输入'+item.name" 
                          v-if="item.valueType==0"
                          style="width: 200px"
                      ></el-input> -->
                      <span v-if="item.valueType==0">{{ item['decimalValue'] }}</span>
                      <!-- <el-input 
                          size="mini"
                          v-model="item['stringValue']" 
                          :placeholder="'请输入'+item.name" 
                          v-if="item.valueType==2"
                          style="width: 200px"
                      ></el-input> -->
                      <span v-if="item.valueType==2">{{ item['stringValue'] }}</span>
                      {{ item.valueUnit }}
                      <!-- <span style="margin-left: 20px" v-if="item.templateFlag==1">自动评估值： 
                        {{ item.value }}
                        {{ item.valueUnit }}
                      </span> -->
                    </el-form-item>
                  </el-form>
                </el-tab-pane>
                <el-tab-pane label="附件" name="fourth">
                  <div v-if="temp.status==1">
                    <el-select v-model="fileTemp.categoryEiid" size="mini">
                        <el-option v-for="item in fileTypeList" :label="item.label" :key="item.value" :value="item.value"></el-option>
                    </el-select>
                    <el-input placeholder="请输入描述" v-model="fileTemp.description" size="mini" style="width: 200px;"></el-input>
                    <el-upload
                        class="upload-demo"
                        :action="OSS_CONFIG.host"
                        :show-file-list="false"
                        :before-upload="hanldeUpload"
                        :data="uploadData"
                    >
                        <el-button size="mini" type="primary">点击附件上传</el-button>
                        <el-progress v-if="uploadProgress > 0" :percentage="uploadProgress" :show-text="false"></el-progress> <!-- 显示进度条 -->
                    </el-upload>
                  </div>
                  <el-table :data="temp.files">
                    <el-table-column label="类型" prop="">
                      <template slot-scope="{row}">
                        {{ transFormTypeValue(row.categoryEiid) }}
                      </template>
                    </el-table-column>
                    <el-table-column label="文件名" prop="showName"></el-table-column>
                    <el-table-column label="描述" prop="description"></el-table-column>
                    <el-table-column label="操作">
                      <template slot-scope="{row}">
                        <el-button type="text" @click="()=>previewImg(OSS_BASE_URL+row.url)" style="margin-right: 5px;">预览</el-button>
                        
                        <el-button type="text"><a :href="OSS_BASE_URL+row.url">下载</a></el-button>
                      </template>
                    </el-table-column>
                  </el-table>
                </el-tab-pane>
            </el-tabs>

            <el-image
              ref="elImage"
              style="width: 0;height:0;"
              :src="previewImgUrl"
              :preview-src-list="[previewImgUrl]"
          ></el-image>
        </div>
      </el-dialog>

       <!-- 询价导出选择字段 -->
      <el-dialog
        title="询价导出"
        :visible="dialogVisibleExport" 
        width="800px" 
        @close="dialogVisibleExport=false" 
        :close-on-click-modal="false"
      >
            <el-form >
                <el-form-item label="询价固定字段" v-if="fiexdFieldList.length>0">
                    <el-checkbox  v-model="checkAllFixed" @change="(val)=>handleCheckAllChange('showFixedFields', val)" >全选</el-checkbox>
                    <el-checkbox-group v-model="params.showFixedFields">
                        <el-checkbox v-for="field in fiexdFieldList" :label="field" :key="field">{{field}}</el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
                <el-form-item label="询价自定义字段" v-if="customFieldList.length>0">
                    <el-checkbox  v-model="checkAllCustom" @change="(val)=>handleCheckAllChange('showCustomFields', val)" >全选</el-checkbox>
                    <el-checkbox-group v-model="params.showCustomFields">
                        <el-checkbox v-for="field in customFieldList" :label="field" :key="field">{{field}}</el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
                <el-form-item label="评估对象固定字段" v-if="subjectFixedFieldList.length>0">
                    <el-checkbox  v-model="checkAllSubjectFixed" @change="(val)=>handleCheckAllChange('showSubjectFixedFields', val)" >全选</el-checkbox>
                    <el-checkbox-group v-model="params.showSubjectFixedFields">
                        <el-checkbox v-for="field in subjectFixedFieldList" :label="field" :key="field">{{field}}</el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
                <el-form-item label="评估对象自定义字段" v-if="subjectCustomFieldsList.length>0">
                    <el-checkbox  v-model="checkAllSubjectCustom" @change="(val)=>handleCheckAllChange('showSubjectCustomFields', val)" >全选</el-checkbox>
                    <el-checkbox-group v-model="params.showSubjectCustomFields">
                        <el-checkbox v-for="field in subjectCustomFieldsList" :label="field" :key="field">{{field}}</el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
            </el-form>
            <div>
                <el-button type="primary" @click="exportData" >导出</el-button>
                <el-button @click="dialogVisibleExport = false">关闭</el-button>
            </div>
      </el-dialog>

    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { inquiryGetList, inquiryInfo, inquirySubmit, inquiryGenerateDoc, inquiryFinish, inquiryUpdate  } from '@/api/inquiry'
import { enumInfo } from '@/api/enum'
import { fieldGetList } from '@/api/field'
import { OSS_BASE_URL, typeNameList, useRightList, STATUS_TYPE_LIST, API_BASE_URL, TARGET_TYPE_LIST, OSS_CONFIG } from '@/utils/common'
import { transfromData,transFormValue, generateUUID } from '@/utils/tools'
import { commonGetUploadFilePolicy } from '@/api/common'
import axios from 'axios'
import moment from 'moment'
import Compressor from 'compressorjs';

let fiexdFieldList = ["系统编号","询价类型","客户公司","客户人员","客户公司业务类型","业务机构","业务员","项目名称","询价状态","回价时间","回价人员","城市", "区县", "街道", "社区","经度","纬度","位置地图"]
let subjectFixedFieldList = ["资产类型","名称","描述","面积"]

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data(){
    return {
      OSS_CONFIG: {
        accessid: '',
        dir: '',
        expire: '',
        host: '',
        policy: '',
        signature: ''
      },
      uploadData: {},
      TARGET_TYPE_LIST,
      API_BASE_URL,
      STATUS_TYPE_LIST,
      typeNameList,
      useRightList,
      list: [],
      total: 0,
      params: {
        pageCount: 10,
        pageIndex: 0,
        customerCompanyBusinessEiid: '',
        cityId: '',
        inquiryType: 0,
        name: '',
        serialNumber: '',
        status: '',
        showCustomFields: [],
        showFixedFields: [],
        showSubjectCustomFields: [],
        showSubjectFixedFields: [],
      },
      OSS_BASE_URL,
      typeNameList,
      dialogVisible: false,
      temp: {
        customerCompany: {},
        businessUser: {},
        fields: [],
        customerUser:{},
      },
      activeName: 'first',
      fileTypeList: [],
      xunjiaFeid: [],
      nowXunjiaFeid: [],
      fileTemp: {
        categoryEiid: '',
        description: ''
      },
      uploadProgress: 0,
      previewImgUrl: '',
      loading: false,
      // 询价导出字段
      dialogVisibleExport: false,
      fiexdFieldList,
      subjectFixedFieldList,
      subjectCustomFieldsList: [], // 按理自定义字段列表
      customFieldList: [], //询价自定义字段列表
      checkAllFixed: false,
      checkAllSubjectFixed: false,
      checkAllCustom: false,
      checkAllSubjectCustom: false
    }
  },
  async mounted(){
    //拿到文件类型
    let fileType = await enumInfo({ id: 37 })
    this.fileTypeList = fileType.items.map(item=>{
        return { label: item.name, value: item.id }
    })
    this.fileTemp.categoryEiid = this.fileTypeList[0].value
        
    //拿询价字段列表
    let xunjia = await fieldGetList({ objectType: 11, pageCount: 999 }); // 查询所有询价模板字段
    let subject = await fieldGetList({ objectType: 8, pageCount: 999 }); // 查询所有评估对象模板字段
    this.xunjiaFeid = xunjia.list.map(item=>{
      if(item.valueType==2){
        item.stringValue = ''
      }
      if(item.valueType==0){
        item.decimalValue = '';
      }
      if(item.valueType==1||item.valueType==3){
        item.longValue = '';
      }
      if(item.valueType==4){
        item.enumItemName = '';
      }
      item.value = ''; //这是用户提交的值
      return item;
    })

    //解析字段
    this.subjectCustomFieldsList = subject.list.map(item=>item.name)
    this.subjectCustomFieldsList = [...new Set(this.subjectCustomFieldsList)] //对数组去重
    this.customFieldList = xunjia.list.map(item=>item.name)
    this.customFieldList = [...new Set(this.customFieldList)] //对数组去重

    this.handleSearch();
    this.getOssConfig();
  },
  methods: {
    //全选按钮
    handleCheckAllChange(name, val) {
        if(name=='showFixedFields'){
            this.params.showFixedFields = val ? this.fiexdFieldList : [];
        }
        if(name=='showSubjectFixedFields'){
            this.params.showSubjectFixedFields = val ? this.subjectFixedFieldList : [];
        }

        if(name=='showCustomFields'){
            this.params.showCustomFields = val ? this.customFieldList : [];
        }

        if(name=='showSubjectCustomFields'){
            this.params.showSubjectCustomFields = val ? this.subjectCustomFieldsList : [];
        }
    },
    //点击导出
    handleExport(){
      // 初始化参数
      this.dialogVisibleExport = true
      this.checkAllFixed = false,
      this.checkAllSubjectFixed = false,
      this.checkAllCustom = false,
      this.checkAllSubjectCustom = false
      this.params.showCustomFields =  []
      this.params.showFixedFields=[]
      this.params.showSubjectCustomFields=[]
      this.params.showSubjectFixedFields=[]
    },
    handleInquire(){
      this.$router.history.push({ path: '/inquiry/add' })
    },
    //点击预览图片
    previewImg(url){
      this.previewImgUrl = url
      this.$nextTick(()=>{
        console.log(this.$refs.elImage)
        this.$refs.elImage.clickHandler();
      })
    },
    uploadFile(file) {
            const formData = new FormData();
            let fileName = generateUUID() + '.' + file.name.split('.')[1];
            let url = this.OSS_CONFIG.dir + fileName;
            let { categoryEiid, description } = this.fileTemp;
            let showName = file.name;
            formData.append('name', fileName);
            formData.append('key', url);
            formData.append('policy', this.uploadData.policy);
            formData.append('OSSAccessKeyId', this.uploadData.OSSAccessKeyId);
            formData.append('success_action_status', this.uploadData.success_action_status);
            formData.append('signature', this.uploadData.signature);
            formData.append('file', file);
            // 发送POST请求到服务器，此处可以使用axios等HTTP客户端库
            axios.post(this.OSS_CONFIG.host, formData, {
                headers: { 'Content-Type': 'multipart/form-data' }
                // onUploadProgress: progressEvent => {
                //     console.log(progressEvent, 111)
                //     // 更新上传进度条的值，这里通常是百分比形式
                //     this.uploadProgress = parseInt(Math.round((progressEvent.loaded * 100) / progressEvent.total));
                //     console.log(progressEvent, 222)
                // }
            }).then(response => {
                this.uploadProgress = 0;
                this.temp.files.push({ url, showName, description, categoryEiid })  // 处理上传成功后的逻辑
            }).catch(error => {
                console.log(error, "失败了")
                // this.handleError(error); // 处理上传失败后的逻辑
            });
    },
    //图片上传前，签名处理
    hanldeUpload(file){
            //做图片压缩处理
            const reader = new FileReader();
            reader.readAsDataURL(file); // 读取文件内容
            reader.onload = (e) => {
                new Compressor(file, {
                    quality: 1, // 压缩质量，范围0.1到1.0之间，1为原图大小，0.6为中等压缩比，可根据需要调整
                    maxWidth: 1920,
                    maxHeight: 1080,
                    convertSize: 2048,
                    success: (compressedResult) => {
                        // 使用压缩后的图片进行上传操作，此处可以直接使用compressedResult上传或者转换为FormData上传
                        this.uploadFile(compressedResult); // 调用上传方法
                    },
                    error(err) {
                        console.error('Compression failed', err.message);
                    },
                    // 其他配置...
                });
            };
            return false; // 阻止自动上传，因为我们手动处理了上传逻辑
    },
    //获取Oss详情
    async getOssConfig(){
      let data = await commonGetUploadFilePolicy();
      this.OSS_CONFIG = data;
      this.uploadData = {
        policy: data.policy,
        OSSAccessKeyId: data.accessid,
        success_action_status: '200',
        signature: data.signature,
        key: data.dir,
        name: ''
      }
    },
    handleSaveClose(){
      this.handleSave();
      this.dialogVisible = false;
    },
    //点击保存
    async handleSave(){
      let temp = JSON.parse(JSON.stringify(this.temp))
      let fields = temp.fields.map(item=>{
        let params = { fieldId: item.id }
        if(item.valueType==2){
          params.stringValue = item.stringValue;
        }
        if(item.valueType==0){
          params.decimalValue = Number(item.decimalValue);
        }
        if(item.valueType==1||item.valueType==3){
          params.longValue = item.longValue;
        }
        if(item.valueType==4){
          params.enumItemName = item.enumItemName;
        }
        return params
      })
      let subjectIds = temp.subjects.map(item=>item.id)
      let { customerCompanyBusinessEiid, files, id, name, replyUserId, latitude, longitude } = temp
      let params = {
        customerCompanyBusinessEiid,fields,
        files,id,name,replyUserId,subjectIds,
        latitude, longitude
      }
      await inquiryUpdate(params);
      this.$message.success({ message: '保存成功' });
    },
    //提交回价
    async submitFinish(){
      await inquiryFinish({ id: this.temp.id });
      this.$message.success({ message: '已回价' });
      this.dialogVisible = false;
      this.getData();
    },
    //生成询价单
    async handleGenerateDoc(){
      await inquiryGenerateDoc({ id: this.temp.id });
      this.$message.success({ message: '已生成' })
      this.getInquiryInfo(this.temp.id);
    },
    //转化文件类型的名称
    transFormTypeValue(id){
      return transfromData(this.fileTypeList, id)
    },
    dateTranfrom(date){
      return moment(date).format('YYYY-MM-DD')
    },
    //点击切换
    handleClick(tab, event){
        // coding...
    },
    //点击查看询价
    handleLook(row){
        this.activeName = 'first';
        this.dialogVisible = true;
        this.getInquiryInfo(row.id);
    },
    // 获取询价详情
    async getInquiryInfo(id){
        this.temp = await inquiryInfo({ id });
        this.nowXunjiaFeid = JSON.parse(JSON.stringify(this.xunjiaFeid))
        // 反已填数值
        this.temp.majorFields.forEach(item=>{
          this.xunjiaFeid.forEach((xunjiaItem, index)=>{
            if(xunjiaItem.id==item.field.id){
              if(item.field.valueType == 0){
                this.nowXunjiaFeid[index]['decimalValue'] = Number(item.decimalValue).toFixed(2)
              }
              if(item.valueType==1||item.valueType==3){
                this.nowXunjiaFeid[index]['longValue'] = Number(item.longValue)
              }
              if(item.field.valueType == 2){
                this.nowXunjiaFeid[index]['stringValue'] = String(item.stringValue)
              }
              if(item.field.valueType == 4){
                this.nowXunjiaFeid[index]['enumItemName'] = String(item.enumItemName)
              }
            }
          })
        })
        //反显自动估价值
        this.temp.minorFields.forEach(item=>{
          this.xunjiaFeid.forEach((xunjiaItem, index)=>{
            if(xunjiaItem.id==item.field.id){
              this.nowXunjiaFeid[index].value = item.decimalValue.toFixed(2)
              if(this.nowXunjiaFeid[index]['decimalValue']==''){
                //如果没有修改值，则赋予他评估的值
                this.nowXunjiaFeid[index]['decimalValue'] = item.decimalValue.toFixed(2)
              }
            }
          })
        })
        this.temp.fields = this.nowXunjiaFeid
        this.temp.subjects = this.temp.subjects.map(item=>{
          item.propertyType = transfromData(TARGET_TYPE_LIST, item.propertyType)
          return item;
        })
    },
    //导出询价单
    exportData(){
        let params = JSON.parse(JSON.stringify(this.params))
        axios({
                url: `${API_BASE_URL}/inquiry/export${transFormValue(params)}`,
                method: 'POST',
                responseType: 'blob'
        }).then((res) => {
                const blob = res.data
                const fileName = moment().format('YYYY-MM-DD') +'自动询价列表.xlsx'
                const elink = document.createElement('a')
                elink.download = fileName
                elink.style.display = 'none'
                elink.href = window.URL.createObjectURL(blob)
                document.body.appendChild(elink)
                elink.click()
                window.URL.revokeObjectURL(elink.href)// 释放对象
                document.body.removeChild(elink)// 移除元素
        })
    },
    //提交询价
    async handleSubmit(row){
      await inquirySubmit({ id: row.id })
      this.$message.success({ message: '提交成功' })
      this.getData();
    },
    // 下载
    async handleDown(row) {
            return fetch(OSS_BASE_URL+row.docUrl).then(response=>{
                if(!response.ok){
                    throw new Error('network not ok')
                }
                return response.blob();
            }).then(blob=>{
                const url = window.URL.createObjectURL(blob);
                const elink = document.createElement('a')
                elink.style.display = 'none'
                elink.href = url;
                elink.download = row.name + '工业不动产询价单.docx'
                document.body.appendChild(elink)
                elink.click()
                window.URL.revokeObjectURL(elink.href)// 释放对象
                document.body.removeChild(elink)// 移除元素

            }).catch(error=>{
                console.log('error', error)
            })
    },
    handleSearch(){
      this.params.pageIndex = 0;
      this.getData();
    },
    // 修改每页数量
    handleSizeChange(val){
        this.params.pageIndex = 0;
        this.params.pageCount = val;
        this.getData();
    },
    // 切换分页
    handleCurrentChange(val){
        this.params.pageIndex = val - 1;
        this.getData();
    },
    async getData(){
      this.loading = true;
      let data = await inquiryGetList(this.params);
      this.loading = false;
      this.total = data.totalCount;
      this.list = data.list.map(item=>{
        item.createTime = moment(item.createTime).format('YYYY-MM-DD HH:mm:ss')
        item.status = transfromData(STATUS_TYPE_LIST, item.status)
        item.inquiryType = transfromData(typeNameList, item.inquiryType)
        return item;
      });
    },
    handleRouter(){
      this.$router.history.push({ path: '/enquiry/add' })
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    background: #f7fafa;

    .upload-demo{
        display: inline-block;
    }
    .el-form-item{
      margin-bottom: 0;
    }
    
    .content{
      padding: 20px;
      border-radius: 5px;
      margin-top: 20px;
      background:#fff;
      .title{
        font-weight: bold;
        .right{
          float: right;
          // padding-top: 40px;
          margin-right: 30px;
          font-weight: normal;
          text-align: right;
        }
      }
      .page{
        padding: 20px 0;
        text-align: center;
      }
    }
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
